<!--conf
<sample in_favorites="false">
              <product version="1.4" edition="std"/>
                     <modifications>
                            <modified date="070101"/>
                     </modifications>
               </sample>
 --> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Configuration from XML</title>
	



</head>

<body>
<link rel='STYLESHEET' type='text/css' href='../common/style.css'>
<table cellspacing="0" cellpadding="0" class="sample_header" border="0">
	<tr valign="middle">
		<!-- COMPONENT ICON -->
		<td width="40" align="center"><img src="../common/dhtmlxgrid_icon.gif" border="0"></td>
		<!-- COMPONENT NAME -->
		<td width="150" align="left" nowrap="true">Sample: dhtmlxGrid</td>
		<!-- SAMPLE TITLE -->
		<td width="0" align="left" nowrap><b>Configuration from XML</b></td>
		<!-- LINK TO COMPONENT PAGE -->
		<td width="0" align="right"><a href="http://www.dhtmlx.com/docs/products/dhtmlxGrid/index.shtml">dhtmlxGrid main page</a></td>
		<!-- CLOSE BUTTON -->
		<td width="50"><div class="sample_close"><a href="javascript:void(0);" onclick="self.close();"><img src="../common/sample_close.gif" width="14" height="14" border="0" alt="X"></a></div></td>
	</tr>
</table>
	
	
	
	<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxgrid.css">
	<script  src="../../codebase/dhtmlxcommon.js"></script>
	<script  src="../../codebase/dhtmlxgrid.js"></script>
	<script  src="../../codebase/dhtmlxgridcell.js"></script>	
	<table width="600">
		<tr>
			<td>
				<div id="gridbox" width="100%" height="250px" style="background-color:white;"></div>
			</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
	</table>
    <a href='#alfa' onclick="if(mygrid.setSerializationLevel){ser();} else {alert('Available in Pro Edition only')}">Serialize grid</a>
<br>
<div class='sample_code'><div class="hl-main"><pre><span class="hl-code"> 
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">div</span><span class="hl-code"> </span><span class="hl-var">id</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">gridbox</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-var">width</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">100%</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-var">height</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">250px</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-var">style</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">background-color:white;overflow:hidden</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">&gt;</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">div</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span><span class="hl-code"><div class="hl-main"><pre><span class="hl-code"> 
        </span><span class="hl-identifier">mygrid</span><span class="hl-code"> = </span><span class="hl-reserved">new</span><span class="hl-code"> </span><span class="hl-identifier">dhtmlXGridObject</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">gridbox</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-code">;
        </span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">setImagePath</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">../../codebase/imgs/</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
        </span><span class="hl-identifier">mygrid</span><span class="hl-code">.</span><span class="hl-identifier">loadXML</span><span class="hl-brackets">(</span><span class="hl-quotes">&quot;</span><span class="hl-string">gridH.xml</span><span class="hl-quotes">&quot;</span><span class="hl-brackets">)</span><span class="hl-code">;
 
        -------</span><span class="hl-identifier">gridH</span><span class="hl-code">.</span><span class="hl-identifier">xml</span><span class="hl-code">-------
        &lt;</span><span class="hl-identifier">rows</span><span class="hl-code">&gt;
          &lt;</span><span class="hl-identifier">head</span><span class="hl-code">&gt;
              &lt;</span><span class="hl-identifier">column</span><span class="hl-code"> </span><span class="hl-identifier">width</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">50</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">dyn</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">align</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">right</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">color</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">white</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">sort</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">str</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-identifier">Sales</span><span class="hl-code">&lt;/</span><span class="hl-identifier">column</span><span class="hl-code">&gt;
              &lt;</span><span class="hl-identifier">column</span><span class="hl-code"> </span><span class="hl-identifier">width</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">150</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">ed</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">align</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">left</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">color</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">#d5f1ff</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">sort</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">str</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-identifier">Book</span><span class="hl-code"> </span><span class="hl-identifier">Title</span><span class="hl-code">&lt;/</span><span class="hl-identifier">column</span><span class="hl-code">&gt;
              &lt;</span><span class="hl-identifier">column</span><span class="hl-code"> </span><span class="hl-identifier">width</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">100</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">ed</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">align</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">left</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">color</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">#d5f1ff</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">sort</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">str</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-identifier">Author</span><span class="hl-code">&lt;/</span><span class="hl-identifier">column</span><span class="hl-code">&gt;
              &lt;</span><span class="hl-identifier">column</span><span class="hl-code"> </span><span class="hl-identifier">width</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">80</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">price</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">align</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">right</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">sort</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">str</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-identifier">Price</span><span class="hl-code">&lt;/</span><span class="hl-identifier">column</span><span class="hl-code">&gt;
              &lt;</span><span class="hl-identifier">column</span><span class="hl-code"> </span><span class="hl-identifier">width</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">80</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">ch</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">align</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">center</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">sort</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">str</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-identifier">In</span><span class="hl-code"> </span><span class="hl-identifier">Store</span><span class="hl-code">&lt;/</span><span class="hl-identifier">column</span><span class="hl-code">&gt;
              &lt;</span><span class="hl-identifier">column</span><span class="hl-code"> </span><span class="hl-identifier">width</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">80</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">co</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">align</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">left</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">sort</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">str</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-identifier">Shipping</span><span class="hl-code">
                  &lt;</span><span class="hl-identifier">option</span><span class="hl-code"> </span><span class="hl-identifier">value</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">1</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-number">10</span><span class="hl-code">&lt;/</span><span class="hl-identifier">option</span><span class="hl-code">&gt;
                  &lt;</span><span class="hl-identifier">option</span><span class="hl-code"> </span><span class="hl-identifier">value</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">2</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-number">20</span><span class="hl-code">&lt;/</span><span class="hl-identifier">option</span><span class="hl-code">&gt;
                  &lt;</span><span class="hl-identifier">option</span><span class="hl-code"> </span><span class="hl-identifier">value</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">3</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-number">30</span><span class="hl-code">&lt;/</span><span class="hl-identifier">option</span><span class="hl-code">&gt;
              &lt;/</span><span class="hl-identifier">column</span><span class="hl-code">&gt;
              &lt;</span><span class="hl-identifier">column</span><span class="hl-code"> </span><span class="hl-identifier">width</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">80</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">ra</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">align</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">center</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">sort</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">str</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-identifier">Bestseller</span><span class="hl-code">&lt;/</span><span class="hl-identifier">column</span><span class="hl-code">&gt;
              &lt;</span><span class="hl-identifier">column</span><span class="hl-code"> </span><span class="hl-identifier">width</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">200</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">type</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">ro</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">align</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">center</span><span class="hl-quotes">&quot;</span><span class="hl-code"> </span><span class="hl-identifier">sort</span><span class="hl-code">=</span><span class="hl-quotes">&quot;</span><span class="hl-string">str</span><span class="hl-quotes">&quot;</span><span class="hl-code">&gt;</span><span class="hl-builtin">Date</span><span class="hl-code"> </span><span class="hl-identifier">of</span><span class="hl-code"> </span><span class="hl-identifier">Publication</span><span class="hl-code">&lt;/</span><span class="hl-identifier">column</span><span class="hl-code">&gt;
          &lt;/</span><span class="hl-identifier">head</span><span class="hl-code">&gt;</span></pre></div></span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">script</span><span class="hl-brackets">&gt;</span></pre></div></div>

<script>
    mygrid = new dhtmlXGridObject('gridbox');
	mygrid.setImagePath("../../codebase/imgs/");
	mygrid.loadXML("gridH.xml");


    function ser(){
        mygrid.setSerializationLevel(false,false,true);
        document.getElementById("alfa1").innerHTML=mygrid.serialize().replace(/\</g,"&lt;").replace(/\>/g,"&gt;").replace(/\&lt;row/g,"<br/>&lt;row");
    }
</script>

<a name="alfa">
<div id="alfa1"></div>
</a>

<!-- FOOTER -->
<table callspacing="0" cellpadding="0" border="0" class="sample_footer"><tr><td style="padding-left: 8px;">&copy; <a href="http://www.dhtmlx.com">DHTMLX LTD</a>. All rights reserved</td></tr></table>
<!-- FOOTER -->

</body>
</html>
